{template common/header}

<!--{if !empty($message)}-->
$ucsynlogin
<script type="text/javascript" reload="1">
{if $message == 2}
	hideWindow('login');
	showWindow('register', '$location');
{elseif $message == 1}
	display('main_messaqge');
	display('layer_login');
	display('layer_message');
	{if $_G['groupid'] == 8}
		$('messageleft').innerHTML = '<p>{lang login_succeed} $usergroups {echo addslashes($_G[username])}</p><p>{lang login_succeed_inactive_member}</p>';
	{else}
		$('messageleft').innerHTML = '<p>{lang login_succeed} $usergroups {echo addslashes($_G[username])}</p>';
	{/if}
	{if !empty($_G['gp_floatlogin'])}
		$('messageright').innerHTML = '<a href="javascript:;" onclick="location.reload()">{lang login_refresh}</a>';
		setTimeout('location.href = location.href', $mrefreshtime);
	{else}
		{eval $dreferer = str_replace('&amp;', '&', dreferer());}
		$('messageright').innerHTML = '<a href="$dreferer">{lang login_location}</a>';
		setTimeout("window.location.href='$dreferer'", $mrefreshtime);
	{/if}
{/if}
setMenuPosition('fwin_login', 'fwin_login', '00');
</script>
<!--{else}-->
<!--{if empty($_G['gp_infloat'])}-->
<div id="pt" class="wp"><a href="index.php" class="nvhm">$_G[setting][bbname]</a> &rsaquo; $navigation</div>
<div  id="ct" class="wp cl">
	<div class="sd">
		&nbsp;
	</div>
	<div class="mn mw">
		<div class="ch">
			<label class="wx">{lang login}</label>
		</div>
<!--{/if}-->

<div class="blr" id="main_messaqge">
	<div id="layer_login">
		<h3 class="flb">
			<em id="returnmessage"><!--{if !empty($_G['gp_infloat'])}-->{lang login_member}<!--{/if}--></em>
			<span><!--{if !empty($_G['gp_infloat'])}--><a href="javascript:;" class="flbc" onclick="hideWindow('login')" title="{lang close}">{lang close}</a><!--{/if}--></span>
		</h3>
		{hook/logging_top}
		<form method="post" autocomplete="off" name="login" id="loginform" class="cl" onsubmit="{if $_G['setting']['pwdsafety']}pwmd5('password3');{/if}pwdclear = 1;ajaxpost('loginform', 'returnmessage', 'returnmessage', 'onerror');return false;" action="member.php?mod=logging&action=login&loginsubmit=yes{if !empty($_G['gp_infloat'])}&floatlogin=yes{/if}">
			<div class="c">
				<input type="hidden" name="formhash" value="{FORMHASH}" />
				<input type="hidden" name="referer" value="$_G['referer']" />
				<div class="lgfm bm nlf">
				
					<!--{if $invite}-->
						<span>
							<label><em>{lang register_from}:</em><a href="home.php?mod=space&uid=$invite[uid]" target="_blank">$invite[username]</a></label>
						</span>
					<!--{/if}-->
					<!--{if $_G['setting']['autoidselect']}-->
						<div class="ftid sipt lpsw" id="account">
							<label for="username">{lang login_id}</label>
							<input type="text" name="username" id="username" autocomplete="off" onblur="$('username_pmenu').style.display='none';" size="36" class="txt" tabindex="1" value="$username" />
						</div>
					<!--{else}-->
						<div class="ftid sipt" id="account">
							<select name="loginfield" style="float: left;" width="61" id="loginfield">
								<option value="username">{lang username}</option>
								<option value="uid">{lang uid}</option>
								<option value="email">{lang email}</option>
							</select>
							<input type="text" name="username" id="username" autocomplete="off" size="36" class="txt" tabindex="1" value="$username" />
						</div>
					<!--{/if}-->
					<p class="sipt lpsw">
						<label for="password3">{lang login_password}</label>
						<input type="password" id="password3" name="password" onfocus="clearpwd()" onkeypress="detectCapsLock(event, this)" size="36" class="txt" tabindex="1" />
					</p>

					<div class="ftid sltp">
						<select id="questionid" width="234" name="questionid" change="if($('questionid').value > 0) {$('answer').style.display='';} else {$('answer').style.display='none';}">
							<option value="0">{lang security_question}</option>
							<option value="1">{lang security_question_1}</option>
							<option value="2">{lang security_question_2}</option>
							<option value="3">{lang security_question_3}</option>
							<option value="4">{lang security_question_4}</option>
							<option value="5">{lang security_question_5}</option>
							<option value="6">{lang security_question_6}</option>
							<option value="7">{lang security_question_7}</option>
						</select>
					</div>
					<p><input type="text" name="answer" id="answer" style="display:none" autocomplete="off" size="36" class="sipt" tabindex="1" /></p>

					<div id="seccodelayer">
					<!--{if checkperm('seccode') && ($secqaacheck || $seccodecheck)}-->
						{block sectpl}<label><em><sec></em><sec></label><label><em style="height:30px">&nbsp;</em><sec></label>{/block}
						{subtemplate common/seccheck}
					<!--{/if}-->
					</div>
					{hook/logging_input}
				</div>
				<div class="lgf minf">
					<h4>{lang login_guest}</h4>
					<p><a href="javascript:;" onclick="display('layer_login');display('layer_lostpw');" title="{lang getpassword}">{lang getpassword}</a></p>
					<!--{if !$_G['setting']['bbclosed']}--><p><a href="javascript:;" onclick="ajaxget('member.php?mod=clearcookies&formhash={FORMHASH}', 'returnmessage', 'returnmessage');return false;" title="{lang login_clearcookies}">{lang login_clearcookies}</a></p><!--{/if}-->
					{hook/logging_side}
				</div>
			</div>
			<p class="fsb cl">
				<!--{if $_G['setting']['sitemessage'][login]}--><a href="javascript:;" id="custominfo_login" class="y"><img src="{IMGDIR}/info_small.gif" alt="{lang faq}" /></a><!--{/if}-->
				<button class="pn pnc" type="submit" name="loginsubmit" value="true" tabindex="1"><span>{lang login}</span></button>
				<label for="cookietime"><input type="checkbox" class="pc" name="cookietime" id="cookietime" tabindex="1" value="2592000" $cookietimecheck /> {lang login_permanent}</label>
			</p>
		</form>
	</div>
	<div id="layer_lostpw" style="display: none;">
		<h3 class="flb">
			<em id="returnmessage3">{lang getpassword}</em>
			<span><!--{if !empty($_G['gp_infloat'])}--><a href="javascript:;" class="flbc" onclick="hideWindow('login')" title="{lang close}">{lang close}</a><!--{/if}--></span>
		</h3>
		<form method="post" autocomplete="off" id="lostpwform" class="cl" onsubmit="ajaxpost('lostpwform', 'returnmessage3', 'returnmessage3', 'onerror');return false;" action="member.php?mod=lostpasswd&lostpwsubmit=yes&infloat=yes">
			<div class="c">
				<input type="hidden" name="formhash" value="{FORMHASH}" />
				<input type="hidden" name="handlekey" value="lostpwform" />
				<div class="lgfm bm">
					<label><em>{lang username}:</em><input type="text" name="username" size="25" value=""  tabindex="1" class="txt" /></label>
					<label><em>{lang email}:</em><input type="text" name="email" size="25" value=""  tabindex="1" class="txt" /></label>
				</div>
				<div class="lgf minf">
					<h4>{lang login_guest}</h4>
					<p><a href="javascript:;" onclick="display('layer_login');display('layer_lostpw');">{lang return_login}</a></p>
				</div>
			</div>
			<p class="fsb cl">
				<em>&nbsp;</em>
				<button class="pn pnc" type="submit" name="lostpwsubmit" value="true" tabindex="100"><span>{lang submit}</span></button>
			</p>
		</form>
	</div>
</div>

<div id="layer_message"{if empty($_G['gp_infloat'])} class="f_c blr nfl"{/if} style="display: none;">
	<h3 class="flb">
		<!--{if !empty($_G['gp_infloat'])}-->
		<em>{lang login_member}</em>
		<span><a href="javascript:;" class="flbc" onclick="hideWindow('login')" title="{lang close}">{lang close}</a></span>
		<!--{/if}-->
	</h3>
	<div class="c"><div class="alert_right">
		<div id="messageleft"></div>
		<p class="alert_btnleft" id="messageright"></p>
	</div>
</div>

<script type="text/javascript" src="{$_G['setting']['jspath']}forum_md5.js?{VERHASH}" reload="1"></script>
<script type="text/javascript" reload="1">
hideWindow('register');
var pwdclear = 0;
function initinput_login() {
	document.body.focus();
	$('loginform').username.focus();
	{if $_G['setting']['autoidselect']}
		showPrompt('username', 'focus', '{lang uid}/{lang username}/{lang email}', 0);
	{else}
		simulateSelect('loginfield');
	{/if}
	simulateSelect('questionid');
}
if(BROWSER.ie && BROWSER.ie < 7) {
	setTimeout('initinput_login()', 500);
} else {
	initinput_login();
}
{if $_G['setting']['sitemessage']['login']}
showPrompt('custominfo_login', 'click', '{echo trim($_G['setting']['sitemessage'][login][array_rand($_G['setting']['sitemessage'][login])])}', $_G['setting']['sitemessage'][time]);
{/if}
{if $_G['setting']['pwdsafety']}
var pwmd5log = new Array();
function pwmd5() {
	numargs = pwmd5.arguments.length;
	for(var i = 0; i < numargs; i++) {
		if(!pwmd5log[pwmd5.arguments[i]] || $(pwmd5.arguments[i]).value.length != 32) {
			pwmd5log[pwmd5.arguments[i]] = $(pwmd5.arguments[i]).value = hex_md5($(pwmd5.arguments[i]).value);
		}
	}
}
{/if}

function clearpwd() {
	if(pwdclear) {
		$('password3').value = '';
	}
	pwdclear = 0;
}

function succeedhandle_lostpwform(url, msg) {
	showDialog(msg, 'notice');
	hideWindow('login');
}
</script>
<!--{/if}-->

{eval updatesession();}
<!--{if empty($_G['gp_infloat'])}-->
	</div></div>
</div>
<!--{/if}-->
{template common/footer}